<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改课程信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-topic-edit" th:object="${courseTopic}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">标题：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">详情：</label>
                <div class="col-sm-8">
                    <input name="desc" th:field="*{desc}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">图片路径：</label>
                <div class="col-sm-8">
                    <input name="imageURLs" th:field="*{imageURLs}" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">厂商id：</label>
                <div class="col-sm-8">
                    <input name="vendorId" th:field="*{vendorId}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">厂商名字：</label>
                <div class="col-sm-8">
                    <input name="vendorName" th:field="*{vendorName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">观测点：</label>
                <div class="col-sm-8">
                    <textarea name="observerpoints" class="form-control">[[*{observerpoints}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">课程包ID：</label>
                <div class="col-sm-8">
                    <input name="coursePackageId" th:field="*{coursePackageId}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/topic";
        $("#form-topic-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-topic-edit').serialize());
            }
        }

        $("input[name='created']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>